GtkMenuTracker: one more visibility tweak
authorRyan Lortie <desrt@desrt.ca>
Wed, 20 Aug 2014 20:00:14 +0000 (16:00 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 14 Dec 2014 23:34:52 +0000 (18:34 -0500)
On creation, we call action_removed() in case the action was missing
from the start.  Because we just created the action, 'can_activate' will
always be FALSE here and this function will therefore always do nothing.

We do want the visibility state to be updated though, for the case where
the action is missing but the item should still be visible from the
start.

Update the visibility directly instead of trying to call
action_removed().

https://bugzilla.gnome.org/show_bug.cgi?id=735122

gtk/gtkmenutrackeritem.c

index a815d330c4f7492ab1be8fcf8fd0cdfe58f8477e..b9185def48a3112b113fd7917380352bdef78b50 100644 (file)
@@ -548,10 +548,9 @@ _gtk_menu_tracker_item_new (GtkActionObservable *observable,
       else
         {
           GTK_NOTE(ACTIONS, g_message ("menutracker: %s missing from the start", action_name));
-          gtk_menu_tracker_item_action_removed (GTK_ACTION_OBSERVER (self), observable, NULL);
+          gtk_menu_tracker_item_update_visibility (self);
         }
 
-
       if (state)
         g_variant_unref (state);
     }